<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
if($_RQ['op']=='list'){
	$return['params']=array();
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid']);
    $orderby='createtime desc';
	$total='';
	if(!empty($_RQ['orderid'])){
		$params['orderid']=intval($_RQ['orderid']);
		$return['params']['orderid']=$_RQ['orderid'];
	}
	if(!empty($_RQ['goodsid'])){
		$params['goodsid']=intval($_RQ['goodsid']);
		$return['params']['goodsid']=$_RQ['goodsid'];
	}
	$return['list']=pdo_getslice('jy_weishop_order_virtual',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	foreach($return['list'] as &$v){
			$v['member']=cfc('core')->member_show($v['mid']);
			$v['goodstitle']=pdo_getcolumn('jy_weishop_goods',array('id'=>$v['goodsid']),'title');
	}
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'发送记录'),
		),
		'list'=>array('data'=>'list','edit'=>false,'delall'=>false,'del_one'=>false,'list'=>array(
			array('name'=>'orderid','title'=>'订单ID','type'=>'string'),
			//array('name'=>'member','title'=>'用户','type'=>'string'),
			array('name'=>'goodstitle','title'=>'商品名称','type'=>'string'),
			array('name'=>'content','title'=>'内容','type'=>'string'),	
			array('name'=>'createtime','title'=>'发送时间','type'=>'time'),			
		)),
		'search'=>array(
			array('name'=>'orderid','width'=>15,'title'=>'订单ID','type'=>'string'),
			array('name'=>'goodsid','width'=>15,'title'=>'商品ID','type'=>'string'),
		)
	);
	$return['htmls']=$htmls;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	exi($return);
}
?>